<template>
    <div>
        <h3>Child</h3>
        <h5>{{msg}}</h5>
        <h6>{{childMsg}}</h6>
        <button @click="passMsg">走你！</button>
    </div>
</template>

<script>


export default {
    name: 'Child',
    props: {
        msg: {
            type: String,
            default: ''
        },
    },
    data () {
        return {
            childMsg: 'child msg'
        }
    },
    methods: {
        passMsg () {
            this.$emit('showMsg', '子传递值给父')
            // alert("hello czr")
        }
    }

}
</script>

<style scoped>

</style>